<?php namespace App\Console\Commands;

use App\Models\Member;
use App\Services\ChuangLan\ChuanglanSmsApi;
use Illuminate\Console\Command;
use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Input\InputArgument;

class SendSms extends Command {

	/**
	 * The console command name.
	 *
	 * @var string
	 */
	protected $name = 'send:sms';

	/**
	 * The console command description.
	 *
	 * @var string
	 */
	protected $description = 'Command description.';

	/**
	 * Create a new command instance.
	 *
	 * @return void
	 */
	public function __construct()
	{
		parent::__construct();
	}

	/**
	 * Execute the console command.
	 *
	 * @return mixed
	 */
	public function fire()
	{
		//
		$data = Member::select('mobile')->get();
		foreach($data as $item){

		}
		$sms        = new ChuanglanSmsApi();
		$r = $sms->sendSMS('13859110181', '【37号铺子】您购买过的全牛皮女鞋秋季新款上新了，今日半价，下手要快！http://t.cn/RCdaJRd.官网微信13168831555可咨询');
		$this->line(json_encode($r));
	}

	/**
	 * Get the console command arguments.
	 *
	 * @return array
	 */
	protected function getArguments()
	{
		return [
//			['example', InputArgument::REQUIRED, 'An example argument.'],
		];
	}

	/**
	 * Get the console command options.
	 *
	 * @return array
	 */
	protected function getOptions()
	{
		return [
//			['example', null, InputOption::VALUE_OPTIONAL, 'An example option.', null],
		];
	}

}
